With development of network technologies and the exponential growth of digital information, the importance of network storage is increasingly apparent, and multiple network storage technologies emerge. An internet small computer system interface (iSCSI) technology is a storage technology that runs the small computer system interface (SCSI) protocol on an internet protocol (IP) network. The iSCSI technology has been widely applied because the iSCSI technology has advantages of simple maintenance, easy-to-expand, and relatively low hardware costs. A schematic diagram of an SCSI protocol module is shown in FIG. 1A.
iSCSI data transfer primarily relates to read and write processes. FIG. 1B is a flowchart of write operation processing.
Step A: An iSCSI initiator sends a write data command to an iSCSI target.
Step B: After receiving the write data command, the iSCSI target allocates a destination address for all data to be written into network storage in a storage area, and sends the destination address to the iSCSI initiator using an ready to transfer (R2T) command.
Step C: The iSCSI initiator sends, to the iSCSI target, a request that carries the to-be-written data, namely, a DATA_OUT message, and the iSCSI target places, by means of copying or using a direct data placement (DDP) technology, the to-be-written data into storage space corresponding to the destination address.
FIG. 1C is a flowchart of read operation processing.
Step a: An iSCSI initiator sends a read data command to an iSCSI target.
In this step, the iSCSI initiator has determined a destination address of to-be-read data.
Step b: The iSCSI initiator receives a Data-In message sent by the iSCSI target, where the Data-In message carries data stored in storage space corresponding to the destination address.
In the write operation processing process shown in FIG. 1B, the iSCSI initiator actually sends data only after receiving an R2T command returned by the iSCSI target. In an actual application, much small-data storage exists in a process of storing data using the iSCSI technology. If a write operation is performed using the foregoing process, a defect of a relatively high transmission delay exists due to complicated interaction operations in a long-distance transmission process.
To reduce a transmission delay in small-data transmission, the interaction step of sending an R2T command is omitted in the iSCSI technology, which is implemented in the following two manners.
A first manner is in a form of a write data command: To-be-written small data is directly carried in a write data command.
A second manner is in a form of a first-sent unsolicited DATA_OUT message: To-be-written small data is directly carried in a first-sent unsolicited DATA_OUT message. The unsolicited DATA_OUT message that carries the to-be-written small data is sent immediately after a write data command, that is, there is no R2T command sent between an unsolicited DATA_OUT message and a write data command.
In the foregoing two manners, the iSCSI initiator may directly send to-be-written small data to the iSCSI target before receiving an R2T command returned by the iSCSI target. However, because the iSCSI target does not obtain a destination address of the to-be-written small data when receiving the to-be-written small data sent by the iSCSI initiator, the iSCSI target needs to perform buffering first when receiving the to-be-written small data sent by the iSCSI initiator.
Buffering to-be-written small data further includes that a host bus adapter (HBA) buffers the to-be-written small data at a driver layer after receiving the to-be-written small data sent by an iSCSI initiator. After the driver layer receives a destination address, delivered by an SCSI layer, of the to-be-written small data, the driver layer copies the buffered to-be-written small data to storage space corresponding to the destination address. It can be seen from the foregoing process that the driver layer stores, in a copying manner, the buffered to-be-written small data into the storage space corresponding to the destination address. However, storage in the copying manner has disadvantages of being time-consuming and low-efficiency. As a result, problems of being time-consuming and low-efficiency exist in a current storage process. In addition, a copying operation is performed at the driver layer, where the driver layer is a software layer, the software layer needs to occupy central processing unit (CPU) resources when performing an operation, and the CPU resources are limited. Therefore, the current data storage method imposes impact on processing rates of other application programs.
In conclusion, the prior-art data storage method has the disadvantages of being time-consuming, low in storage efficiency, and affecting processing rates of other application programs.